class City{
    name: string;
    postcode: string;
    
       // 构造函数 
       constructor(name: string,postcode:string) { 
        this.name = name;
        this.postcode = postcode; 
    }  

    cityInfo(){
        console.log("cityname:" + this.name);
    }
}

var city = new City("fuzhou","350000");
city.cityInfo()
console.log(city.postcode)

//继承
class FzCity extends City {
    level: number;

    static area: number

    constructor(level: number) { 
        super();
        this.level = level;
    }

    //方法重写
    cityInfo(){
        super.cityInfo()
        console.log("level:" + this.level);
    }

    //私有方法
    private cityXx(){
        console.log("cityXx")
    }
}

var fzCity = new FzCity(1)
fzCity.name = "Fuzhou"
console.log(fzCity.level)
console.log(fzCity.name)
fzCity.cityInfo()

FzCity.area = 2000
console.log(FzCity.area)

console.log(fzCity instanceof FzCity)//true
console.log(fzCity instanceof City)//true



